<h1 class="page-header">
    <small>快速收款</small>
</h1>
<hr/>
<div class="panel panel-inverse" data-sortable-id="form-stuff-1">
    <div class="panel-heading">
        <h4 class="panel-title">快速收款</h4>
    </div>
    <div class="panel-body">
        <div class="cashier-form">
            <form id="cashierForm" name="cashierForm" method="post" onSubmit="return false;" class="form-horizontal">
                <div class="form-group">
                    <label class="col-md-3 control-label">手机号：</label>
                    <div class="col-md-5">
                        <input type="text" id="mobile" class="form-control mobile" name="mobile" placeholder="请输入会员手机号，或使用扫码枪扫描会员二维码" rangelength="1,1000" required/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-3 control-label">收款金额：</label>
                    <div class="col-md-5">
                        <input type="text" id="amount" class="form-control amount" name="amount" placeholder="请输入收款金额" rangelength="1,10" required/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-3 control-label">卡券号码：</label>
                    <div class="col-md-5">
                        <input type="text" id="couponCode" class="form-control" name="couponCode" placeholder="请输入卡券号码，或使用扫码枪扫描卡券二维码" rangelength="1,10" required/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-3 control-label"></label>
                    <div class="col-md-9">
                        <button type="button" class="btn btn-sm btn-default" onclick="getData('${rc.contextPath}/backend/home/index','displayArea')">返回</button>
                        <button type="button" id="submitButton" class="btn btn-sm btn-danger" onclick="toCashier()">发起收款</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script type="application/javascript">
    // 扫码枪回车事件
    $('#mobile').bind('keyup', function(event) {
        if (event.keyCode == "13") {
            return false;
        }
    });
    // 发起收款
    function toCashier() {
       const mobile = $("#mobile").val();
       if (mobile.length < 11) {
          layer.alert("请输入会员手机号！");
          return false;
       }
    }
</script>